﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="User.aspx.cs" Inherits="Manage_admin_user" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>用户管理</title>
    <link rel="stylesheet" type="text/css" href="../skin/css/base.css" />
    <script src="../script/jquery.min.js" type="text/javascript" language="javascript"></script>
    <script src="../script/jquery-ui.min.js" type="text/javascript" language="javascript"></script>
    <script language="javascript" type="text/javascript">
        function selectall() {
            if (document.getElementById("chkSelect").checked == true) {
                v = true;
            }
            else {
                v = false;
            }
            var f = document.forms[0];
            for (i = 0; i < f.elements.length; i++)
                f.elements[i].checked = v;
        }
      
    </script>
    <style type="text/css">
        .cinputedit
        {
            border: solid 1px green;
        }
        .cinput
        {
            border: none;
        }
    </style>
</head>
<body leftmargin="8" topmargin="8" background='../skin/images/allbg.gif'>
    <form id="form1" runat="server">
    <!--  快速转换位置按钮  -->
    <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">
        <tr>
            <td height="26" background="../skin/images/newlinebg3.gif">
                <table width="98%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="right">
                            <asp:Button ID="adduser" runat="server" CssClass="coolbg np" Text="添加用户" OnClick="adduser_Click" />&nbsp;&nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--  内容列表   -->
    <div id="form2">
        <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center"
            style="margin-top: 8px">
            <tr bgcolor="#E7E7E7">
                <td height="24" colspan="4" background="../skin/images/tbg.gif">
                    &nbsp;用户列表&nbsp;&nbsp;
                    <asp:FileUpload ID="fuExcel" runat="server" ToolTip="选择Excel文件" Height="18px" 
                        Width="381px"  />
                    &nbsp;&nbsp;
                    <asp:Button class="coolbg" ID="btnInput"  
                        runat="server" Text="从Excel导入" onclick="btnInput_Click"   />
                </td>
            </tr>
            <tr align="center" bgcolor="#FAFAF1" height="22">
                <td width="10%">
                   ID
                </td>
                <td width="4%">
                    选择<asp:CheckBox ID="chkSelect" onclick="selectall();" runat="server" />
                </td>
                <td width="22%">
                    编号
                </td>
                <td width="22%">
                    名称
                </td>
                 <td width="22%">
                    角色
                </td>
                <td width="20%">
                    操作
                </td>
            </tr>
            <asp:Repeater ID="dguser" runat="server" OnItemCommand="dguser_ItemCommand" OnItemDataBound="dguser_ItemDataBound">
                <ItemTemplate>
                        <tr align='center' bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';"
                            onmouseout="javascript:this.bgColor='#FFFFFF';" height="22">
                            <td>
                                <%#Eval("UserId").ToString()%>
                            </td>
                            <td>
                                <asp:CheckBox ID="chkID" runat="server" /><asp:HiddenField ID="hdfUserId" runat="server"
                                    Value='<%#Eval("UserId") %>' />
                            </td>
                             <td align="left">
                                <asp:Label ID="lblcode" runat="server" Text='<%#Eval("Code") %>'></asp:Label>
                            </td>
                            <td align="left">
                                <asp:Label ID="lblname" runat="server" Text='<%#Eval("Name") %>'></asp:Label>
                            </td>
                            <td align="left">
                                <asp:Label ID="lblrole" runat="server" Text='<%#Eval("GroupName") %>'></asp:Label>
                            </td>
                            <td>
                                <asp:LinkButton runat="server" ID="lbtEdit" CommandArgument='<%#Eval("UserId")%>'
                                    CommandName="Edit" Text="编辑"></asp:LinkButton>&nbsp;&nbsp;
                                <asp:LinkButton runat="server" ID="lbtDelete" CommandArgument='<%#Eval("UserId")%>'
                                    CommandName="Delete" Text="删除" OnClientClick="return confirm('确定要删除？')"></asp:LinkButton>
                            </td>
                        </tr>
                </ItemTemplate>
            </asp:Repeater>
            <tr bgcolor="#FAFAF1">
                <td height="28" colspan="4">
                    &nbsp;
                    <asp:Button class="coolbg" ID="btnDeleteMass" OnClientClick="return confirm('你确定要删除选择记录吗?');"
                        runat="server" Text="批量删除" OnClick="btnDeleteMass_Click" />
                    &nbsp;&nbsp;
                    
                </td>
            </tr>
            <tr align="right" bgcolor="#EEF4EA">
                <td height="36" colspan="4" align="center">
                    <webdiyer:AspNetPager ID="pager1" runat="server" OnPageChanged="pager1_PageChanged"
                        PageSize="10">
                    </webdiyer:AspNetPager>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
